package com.xinke.module.system.mapper.notice;

import java.util.*;

import com.xinke.component.common.pojo.PageResult;
import com.xinke.component.mybatis.mybatis.core.query.LambdaQueryWrapperExt;
import com.xinke.component.mybatis.mybatis.core.mapper.BaseMapperExt;
import com.xinke.module.system.model.entity.notice.NoticeDO;
import org.apache.ibatis.annotations.Mapper;
import com.xinke.module.system.model.vo.notice.*;

/**
 * 通知公告 Mapper
 *
 * @author yzx
 */
@Mapper
public interface NoticeMapper extends BaseMapperExt<NoticeDO> {

    default PageResult<NoticeDO> selectPage(NoticePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperExt<NoticeDO>()
                .eqIfPresent(NoticeDO::getNoticeTitle, reqVO.getNoticeTitle())
                .eqIfPresent(NoticeDO::getNoticeContent, reqVO.getNoticeContent())
                .eqIfPresent(NoticeDO::getNoticeType, reqVO.getNoticeType())
                .eqIfPresent(NoticeDO::getNoticeStatus, reqVO.getNoticeStatus())
                .orderByDesc(NoticeDO::getNoticeId));
    }

}